import { BuyVIPWindow } from "../vip/BuyVIPWindow";
import { GameManager } from "../../manager/GameManager";
import { GameController } from "../../mvc/GameController";
import { Dispatcher } from "../../../mvc/core/Dispatcher";
import { DataEvent } from "../../events/DataEvent";
import { EventName } from "../../mvc/EventName";
import { Cache } from "../../cache/Cache";
import { ENpcEffect } from "../../../../Message/Public/ENpcEffect";
import { AIManager } from "../../scene/ai/AIManager";
import { DailyRule } from "../../rules/DailyRule";
import { ParamsConst } from "../../../common/global/ParamsConst";
//class MailUtil
    
    export  class MailUtil
    {
        

        public static dealMailLinkByType(arg1: string): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=arg1;
            switch (loc3) 
            {
                case "OpenBuyVIPWindow":
                {
                    BuyVIPWindow.instance.show();
                    return;
                }
                case "OpenPetHireWindow":
                {
                    GameManager.instance.popupView(GameController.petHire.view);
                    return;
                }
                case "OpenPetExplorePackWindow":
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.PetExplorePackWindowOpen));
                    return;
                }
                case "ShowDelegateWareHouse":
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.ShowDelegateWareHouse));
                    return;
                }
                case "ShowDelegateModule":
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.ShowDelegateTaskWindow));
                    return;
                }
                case "OpenSealNpc":
                {
                    loc1 = Cache.instance.scene.getNpcByEffect(ENpcEffect._ENpcEffectSeal);
                    AIManager.onAutoPathAIControl(loc1);
                    return;
                }
                case "OpenRobIslandNpc":
                {
                    loc2 = Cache.instance.scene.getNpcByEffect(ENpcEffect._ENpcEffectRobIslandExchange);
                    AIManager.onAutoPathAIControl(loc2);
                    return;
                }
                case "OpenSpecialActiveCharge":
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.DailyGiftOpen, DailyRule.SpecialActive));
                    return;
                }
            }
            return;
        }

        public static isDictHasItem(arg1: Map<any, any> /* flash.utils.Dictionary */): Boolean
        {
            var loc1=null;
            var loc2=0;
            var loc3=arg1;
            for (loc1 in loc3) 
            {
                return true;
            }
            return false;
        }

        public static getReplaceContent(arg1: string): string
        {
            arg1 = arg1.replace("[5FBURL]", ParamsConst.instance.TW5FBURL);
            return arg1;
        }
    }
